import { createBrowserRouter } from "react-router-dom";
import Home from "../pages/home/home";
import App from "../App";
import Email from "../pages/email/email";
import Code from "../pages/code/code";
import Translator from "../pages/translator/translator";
import EmailList from "../pages/email/emailList";
import EmailInfo from "../pages/email/emailInfo";
import Login from "../pages/login/login";
import Register from "../pages/register/register";

const router:any = createBrowserRouter([{
    path:'/',
    element: <App />,
    children:[{
        path:'home',
        element:<Home />
    },{
        path:'/email',
        element: <Email />,
        children:[{
            path:'/email/index',
            element:<EmailList />,
        },{
            path:'/email/info/:id',
            element: <EmailInfo />
        }]
    },{
        path:'/code',
        element:<Code />,
    },{
        path:'/translator',
        element:<Translator />, 
    },{
        path: '/login',
        element: <Login />
    },{
        path: '/register',
        element: <Register />,
    }]    
}])

export default router;